<MultiSelectDropDown2@DropDown>:




MyLayout:
  orientation: 'vertical'
  size_hint: 1,1

  BoxLayout:
    size_hint_y: None
    height: 60
    pos_hint: { "center_x": 0.5, "center_y": 0 }
    canvas.before:
      Color:
        rgba: 0, 1, 1, 1  # 设置颜色为红色
      Line:
        width: 1  # 设置边框宽度
        rectangle: self.x, self.y, self.width, self.height
    Button:
      size_hint: (None, None)
      size: (200, 50)
      text: '门票场次3添加'
#      or_release: root.add_tickets_option()
      on_release: root.add_tickets_option()
    Button:
      size_hint: (None, None)
      size: (200, 50)
      text: '门票场次3选择'
      #      or_release: root.add_tickets_option()
      on_release: root.select_tickets_option()

  BoxLayout:
    size_hint_y: None
    height: 60
    pos_hint: { "center_x": 0.5, "center_y": 0 }
    canvas.before:
      Color:
        rgba: 1, 1, 0, 1  # 设置颜色为红色
      Line:
        width: 1  # 设置边框宽度
        rectangle: self.x, self.y, self.width, self.height

    # 按钮实现复选框（选中效果不好）
    BoxLayout:
      Button:
        canvas.before:
          Color:
            rgba: 1, 0, 0, .7  # 设置颜色为红色
          Line:
            width: 1  # 设置边框宽度
            rectangle: self.x, self.y, self.width, self.height
        size_hint: (None, None)
        size: (200, 50)
        color: 0, 0, 0, 1  # 设置文字颜色为红色
        id: ground_ids
        text: "请选择门票场次"
        on_parent: dropdown.dismiss()
        on_release: dropdown.open(self)
    DropDown:
      canvas.before:
        Color:
          rgba: 0, 0, 1, .5  # 设置颜色为红色
        Line:
          width: 1  # 设置边框宽度
          rectangle: self.x, self.y, self.width, self.height
  #      auto_dismiss: False # 默认情况下，当触摸发生在下拉菜单之外时，下拉菜单将自动关闭，设置为False禁用此功能
      dismiss_on_select: False # 默认情况下，当选择完成后，下拉菜单将自动取消。设置为False禁用此功能
      id: dropdown
      on_select: ground_ids.text = '{}'.format(args[1])
      Button:
        text: 'First Item'
        size_hint_y: None
        height: 35
        on_release: root.drop_down_click(self)
  #        on_release: dropdown.select('First Item')

      Label:
        text: 'Second Item'
        size_hint_y: None
        height: 35

      Button:
        text: 'Third Item'
        size_hint_y: None
        height: 35
        on_release: root.drop_down_click(self)
  #        on_release: dropdown.select('Third Item')

    # checkBox实现复选框
    BoxLayout:
      Button:
        canvas.before:
          Color:
            rgba: 0, 0, 1, .7  # 设置颜色为红色
          Line:
            width: 1  # 设置边框宽度
            rectangle: self.x, self.y, self.width, self.height
        size_hint: (None, None)
        size: (200, 50)
        color: 0, 0, 0, 1  # 设置文字颜色为红色
        id: dropdown2_text
        text: "请选择门票场次2"
        on_release: root.dropdown2.open(self)


    # checkBox实现复选框
    BoxLayout:
      Button:
        canvas.before:
          Color:
            rgba: 0, 0, 1, .7  # 设置颜色为红色
          Line:
            width: 1  # 设置边框宽度
            rectangle: self.x, self.y, self.width, self.height
        size_hint: (None, None)
        size: (200, 50)
        color: 0, 0, 0, 1  # 设置文字颜色为红色
        id: dropdown3_text
        text: "请选择门票场次3"
        on_release: dropdown3.open(self)
        on_parent: dropdown3.dismiss()

      # 这种引用方法需要注意参数顺序，add_items需要放最后，顺序错了会报错
      MultiSelectDropDown:
        id: dropdown3
        main_button: dropdown3_text
        options: ['111', '222', '333', '444']
        selected_options: ['222','333']
  BoxLayout: